import type { RuleItem } from "async-validator";
import { ExtractPropTypes, InjectionKey, PropType, VNodeChild } from 'vue';
export type Arrayable<T> = T | T[];
export interface FormItemRule extends RuleItem{
    trigger?:Arrayable<string>
}
export const formItemValidateState = ['success', 'error', ''] as const
export type FormItemValidateState = typeof formItemValidateState[number]

export const formItemProps = {
  prop: String,
  label: String,
  rules: [Object, Array] as PropType<Arrayable<FormItemRule>>,
  showMessage: {
    type: Boolean,
    default: true
  }
} as const

export type FormItemProps = Partial<ExtractPropTypes<typeof formItemProps>>
